import { createRouter, createWebHistory } from 'vue-router';
import AmmeterPage from '../views/AmmeterPage.vue';
import WaterMeter from '../views/WaterMeterPage.vue';
import PressureMeter from '../views/PressureMeterPage.vue';
import TemperatureMeter from '../views/TemperatureMeterPage.vue';
import TrifurcateMeter from '@/views/TrifurcateMeterPage.vue';
import IndicatorMeter from '../views/IndicatorMeterPage.vue';



const routes = [
    {
        path: '/',
        redirect: '/AmmeterPage'
    },
    {
        path: '/AmmeterPage',
        name: 'AmmeterPage',
        component: AmmeterPage
    },
    {
        path: '/WaterMeter',
        name: 'WaterMeter',
        component: WaterMeter
    },
    {
        path: '/PressureMeter',
        name: 'PressureMeter',
        component: PressureMeter
    },
    
    {
        path: '/TemperatureMeter',
        name: 'TemperatureMeter',
        component: TemperatureMeter,
        props: (route) => ({ meter: route.params.meter })
    },

    {
        path: '/TrifurcateMeter',
        name: 'TrifurcateMeter',
        component: TrifurcateMeter
    },

    {
        path: '/IndicatorMeter',
        name: 'IndicatorMeter',
        component: IndicatorMeter
    },
];

const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router;
